﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Тхи_4_лаба;


namespace Тхи_5_лаба
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                create_airplanes create = new create_airplanes();
                int kol_sy1;
                int kol_sy2;
                kol_sy1 = Convert.ToInt32(textBox1.Text);
                kol_sy2 = Convert.ToInt32(textBox2.Text);

                sy1 sy1_ = create.create_sy1(kol_sy1);
                sy2 sy2_ = create.create_sy2(kol_sy2);
                company company_ = create.create_company(sy1_, sy2_);
                calculater calc = new calculater();

                string str = "общее количество пассажиров " + calc.Calculate(company_);
                MessageBox.Show(str);
            }
            catch (Exception)
            {
                MessageBox.Show("Не ввели данные о самолете");
            }
        }

    }
}
